import System
import System.IO
import System.Data

import Banshee.Base
import Banshee.ServiceStack
import Banshee.PlaybackController
import Banshee.MediaEngine

def AutoPlay() as bool:
	ServiceManager.PlaybackController.ShuffleMode = PlaybackShuffleMode.Song
	ServiceManager.PlayerEngine.Play()
	ServiceManager.PlaybackController.ShuffleMode = PlaybackShuffleMode.Linear

def OnClientStarted( client as Client ):
	Hyena.Log.Information( "engine is playing now..." )
	GLib.Timeout.Add(1500, AutoPlay)
	Banshee.ServiceStack.Application.ClientStarted -= OnClientStarted

Hyena.Log.Information( "autoplay script is loaded." )

Banshee.ServiceStack.Application.ClientStarted += OnClientStarted

